package cn.edu.just.firstjavaapp.l10.v2;

public class DrawApp {
    public static void main(String[] args) {
        
        Shape[] shapes = new Shape[100];
        int count =0;

        shapes[count++] = new Rectangle(3,6,18,39);
        shapes[count++] = new Rectangle(4,8,8,56);

        shapes[count++] = new Circle();

        shapes[count++] = new Rectangle(32,16,83,15);
        shapes[count++] = new Rectangle(32,16,83,15);
        shapes[count++] = new Rectangle(100,200,48,92);
        shapes[count++] = new Rectangle(76,54,20,78);
        shapes[count++] = new Rectangle(23,67,42,76);

        shapes[count++] = new Circle(4,5,100);
        shapes[count++] = new Circle(20,30,80);

       //对扩展开放，对修改关闭
        for(int i=0;i<count;i++){
            shapes[i].draw();//多态性
        }

    }
}
